package com.shuzijun.leetcode.editor.cn;

public class RecursiveMulitplyLcci{
    public static void main(String[] args) {
         Solution solution = new RecursiveMulitplyLcci().new Solution();
    }
    //leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public int multiply(int A, int B) {
        if (A == 1) return B;
        int halfValue = multiply(A/2,B);
        if (A%2 == 1){
            return halfValue+halfValue+B;
        }else {
            return halfValue+halfValue;
        }
    }
}
//leetcode submit region end(Prohibit modification and deletion)

}